<!--<table cellpadding="5" cellspacing="0" width="100%">
	<tr>
		<?php
			$id=$_GET['id'];
			$query1="select * from categories where id=$id";
			$result1=mysql_query($query1);
			while($row1=mysql_fetch_array($result1)){
			?>
				<td class="sp_home_title" width="100%">
					 <?php echo $row1['cateName'];?>
				</td>
		<?php
		}
		?>		
	</tr>
</table>-->
<?php include("menucontenttop.php");?>
<table cellspacing="2" cellpadding="0"  class="sp_home" align="left" width="100%">
	<tr>
		<?php
		$id=$_GET['id'];
		
			
		$query = "select * from productdetails where id = $id";
		$result = mysql_query($query);
		$a=1;
		while($row = mysql_fetch_array($result)){
		$allow_doawnload = $row['imgpath'];
		$view = $row['productView'] + 1;
		$queryview = "UPDATE productdetails SET productView = $view WHERE id=$id";
		mysql_query($queryview) or die(mysql_error());
			
		?>
		<td height="100%" align="center" valign="top">
			<div class="sp_moi_content">
			
			<div class="khung_sp_tc_main">
				<table border="0" cellspacing="0" cellpadding="0" width="100%">
					<tr>
						<td class="content-box" width="100%">
							<div align="left" ><a href="index.php?page=listproductDetail&id=<?php echo $row['id'];?>" ><?php echo $row['productname'];?></a></div>
						</td>
					</tr>
					<tr>
						<td class="content-second" width="100%"><?php echo $row['productDetail'];?></td>
					</tr>
					<tr>
						<td class="date_created">
							Ngày tạo : <?php $ngay = date('d/m/Y', $row['dateCreated']); echo $ngay;?>  -  <span class="view-detail-download"><a href="index.php?page=listviewproductDetail&id=<?php echo $row['id'];?>">Xem chi tiết tải về</a></span> - Lượt tải về : <?php echo $row['download'];?> - Lượt xem : <?php echo $row['productView'];?><br/>
							<?php
								//print_r($allow_doawnload);
								if($allow_doawnload==''){?>
									<img src="img/nodownload.gif">
							<?php
							}else{?>
								<a href="download.php?id=<?php echo $row['id'];?>"]><img src="img/download.gif"></a>
							<?php
							}
							?>
							
						</td>
					</tr>
					<tr>
						<td align="center" valign="bottom" width="100%">
						
						<!--<div class="luotxem">Lượt xem : <?php echo $row['productView'];?></div>-->
						</td>
					</tr>
					<tr>
						<td align="center" valign="bottom" width="100%" height="10%">
							 <!--<input type="button" value="Mua hàng" onclick="addtocart(<?=$row['id']?>)" />-->
						</td>
					</tr>
				</table>
			</div>
			</div>
		</td>
		<div style="display:none;" id="<?php echo $row['id'];?>"><?php echo $row['productDetail'];?></div>
		 <?php
		if($a%1==0){
			echo "<tr></tr>";	
		}
		$a=$a+1;
	   }
		 
		?>
	</tr>
</table>